#快速排序使用分治法，取哨兵位进行比较，大于放一边，小于放一边，相等的放任何一边都可，最后返回
def quickSort(list):
    if len(list)<=1:
        return list
    middile = list[0]
    list_l = [x for x in list[1:] if x < middile]
    list_r = [x for x in list[1:] if x >= middile]
    return quickSort(list_l)+[middile]+quickSort(list_r)
print(quickSort([2,5,3,1,9,6,8]))
